import request from "@/utils/request";

export default{
  //根据分页查询数据
  getTableDataApi(searchModel){
    return request({
        url:'/user/selectPageData',
        method:'post',
        params:{
          page:searchModel.currentPage,
          size:searchModel.pageSize,
          username:searchModel.username,
          phone:searchModel.phone
        }
    })
  },

  //修改用户状态
  updateStatusApi(row) {
    return request({
      url:'/user/updateStatusById',
      method:'post',
      data:row
    })
  },

  //编辑/新增
  updateAndSaveApi(form) {
    return request({
      url:'/user/updateAndSave',
      method:'post',
      data:form
    })
  },

  //根据id删除
  delDataApi(id) {
      return request({
        url:`/user/delDataById/${id}`,      //resful风格
        method:'delete',
      })
  },

  //批量删除
  delDataByIdsApi(ids) {
    return request({
      url:`/user/delDataByIds`,
      method:'post',
      data:ids
    })
  }
}
